type BizObject = BIZAPI.ProDataRevenueYearEntity & {
  editable?: boolean;
};

const zdList = [
  '洛碛餐厨污水厂',
  '黑石子渗滤液污水厂',
  '洛碛渗滤液污水厂',
  '界石渗滤液污水厂',
  '走马渗滤液污水厂',
  '夏家坝渗滤液污水厂',
  '洛碛一体化污水厂',
  '界石一体化污水厂',
  '走马一体化污水厂',
  '洛碛原水厂'
];

const createMonthlyDataItems = (): Partial<BizObject>[] => {
  const obj: Partial<BizObject>[] = [];
  for (let i = 0; i < 12; i++) {
    obj.push({
      ['target' + (i + 1)]: 0,
      ['amount' + (i + 1)]: 0
    });
  }

  return obj;
};

export const tableSource = (): BizObject[] => {
  const data: BizObject[] = zdList.map((item) => {
    return {
      ...createMonthlyDataItems().reduce((acc, cur) => ({ ...acc, ...cur }), {}),
      zd: item,
      year: undefined
    } as BizObject;
  });
  return data;
};
